{
	"desc_en": "creates a view addon (widget)",
	"args": [ "extension", "name" ],
	"file": "vendor/phppe/@EXTENSION@/addons/@NAME@.php"
}
<?php
@@BRIEF

namespace PHPPE\AddOn;

use PHPPE\Core;
use PHPPE\View;

class @NAME@ extends \PHPPE\AddOn
{
	function init()
	{
		Core::addon("@name@", "@Name@ widget", "", "*");
	}

	function show()
	{
		return htmlspecialchars($this->value);
	}

	function edit()
	{
		View::jslib("@name@.js", "@name@_init('".$this->fld."');");
		View::css("@name@.css");
		return "<div id='".$this->fld.":container'>".
			"<input type='text' name='".$this->fld."' value=\"".htmlspecialchars($this->value)."\"></div>";
	}

	static function validate ( $name, &$value, $required, $arguments, $attributes )
	{
		return [true, "Success"];
	}
}
